package com.freecloud.javabasics.datatype;

import org.junit.Test;

/**
 * @Author: maomao
 * @Date: 2020-06-22 14:40
 */
public class BigDecimal {


    @Test
    public void retain2(){

        java.math.BigDecimal money = new java.math.BigDecimal("-63.6666670000000038953658076934516429901123046875");
        money.setScale(2, java.math.BigDecimal.ROUND_DOWN);

        System.out.println(money.toString());

        System.out.println(money.toPlainString());

        System.out.println(money.toEngineeringString());

        System.out.println(money.toBigInteger());

        System.out.println(money.doubleValue());


        System.out.println(money.setScale(2, java.math.BigDecimal.ROUND_DOWN).toString());
    }
}
